package recursive_algorithm_package;

public class recursive_algorithm_demo2 {
    public static void main(String[] args) {
        //需求：利用递归求5的阶乘

        System.out.println(getFactorial(5));
    }

    public static int getFactorial(int number) {
        if (number == 1) {
            return 1;
        }

        return number * getFactorial(number - 1);
    }
}
